﻿namespace EFML_Runtime
{
    using System.IO;

    using EFML_Runtime.Properties;

    public class Program
    {
        #region Methods

        private static void Main(string[] args)
        {
            var e = new Exeutable
                {
                    Info =
                        {
                            ApplicationName = "Test",
                            Author = "Chris Marco Anders",
                            Copyright = "2014 Furesoft",
                            Description = "A simle test application",
                            Version = "0.0.0.1",
                            Website = "http://www.furesoft.pf-control.de/"
                        },
                    MainForm = "main.window",
                    MainLanguage = "de-DE"
                };
            var ms = new MemoryStream();
            Resources.Franksouza183_Fs_Apps_firefox.Save(ms);
            e.Info.Icon = ms.ToArray();

            e.Sources.Add(
                "main.window",
                "<window><head><meta name='ControlProvider' value='metro.cp' /><meta name='Title' value='Hello World' /><script>var x = new ActiveXObject('Excel.Application'); x.Visible=true; function colorChange() {alert('hallo welt');window.style.backgroundcolor = color('blue');}</script></head><body><br id='break' /><link id='dd' value='@string/changecolor' onclick='colorChange();' /><br id='break2' /><dropdown id='drop' onselectionchange='colorChange()'><item value='@string/changecolor' /></dropdown></body></window>");
            e.Resources.Add("good.audio", new byte[] { 255, 1, 2, 55, 2 });
            e.Strings.Add("de-DE", "<strings><string name='changecolor' value='Auf Blau ändern' /></strings>");
            e.Strings.Add("en-ZA", "<strings><string name='changecolor' value='Change to blue' /></strings>");

            e.Save(new FileStream("test.era", FileMode.OpenOrCreate));
            // e.Load(new FileStream("test.era", FileMode.OpenOrCreate));

            var app = new App(args[0]);
            app.Start();
        }

        #endregion
    }
}